package jym.tan.tmdb.method.get;

import java.net.URL;

import jym.tan.tmdb.TMDB;
import jym.tan.tmdb.constant.TMDBConstants;
import jym.tan.tmdb.method.Base;

/**
 * The Class PersonInfo. This class is similar to the <b>Person Info</b> method described in 
 * <a href="http://help.themoviedb.org/kb/api/person-info">Person Info</a>.
 * This method is used to retrieve all of the basic person information. It will return the 
 * single highest rated profile image.
 * @author Tanmoy
 */
public class PersonInfo extends Base {

	/**
	 * Instantiates a new PersonInfo.
	 *
	 * @param tmdb 
	 * 		An instance of the {@link TMDB} class
	 */
	public PersonInfo(TMDB tmdb) {
		super(tmdb, TMDBConstants.PERSON);
	}

	/**
	 * Gets a {@link jym.tan.tmdb.bean.PersonInfo} object.
	 *
	 * @param personId 
	 * 		The Person id
	 * @return 
	 * 		The <code>jym.tan.tmdb.bean.PersonInfo</code> object
	 * @throws Exception 
	 * 		If any kind off exception occurred
	 */
	public jym.tan.tmdb.bean.PersonInfo getPersonInfo(String personId) throws Exception {
		URL infoURL = getUrl(personId);
		jym.tan.tmdb.bean.PersonInfo personInfo = getJsonObject(infoURL, jym.tan.tmdb.bean.PersonInfo.class);		
		return personInfo;		
	}
}
